package com.app.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.app.common.core.IBaseDAO;
import com.app.dao.DemoDAO;
import com.app.pojo.Demo;

/**
 * Description: service层 <br/>
 * Date: 2017年3月9日 上午11:52:17 <br/>
 * 
 * @author xuejianxin
 */
@Service("DemoService")
public class DemoService implements IDemoService {
	@Autowired
	private DemoDAO dao;

	@Override
	public IBaseDAO<Demo, String> getDao() {
		return dao;
	}

	
	
	 public Integer save(Demo entity) {
		dao.save(entity);
		//测试事物
		java.util.List<Demo> ds = queryForList(null);
		ds.forEach(o -> System.out.println(o));
		return 1;
	}
}
